package com.anycl.customer.vo;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.StringUtils;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class CustomerVo {
    private Long id;
    private String name;
    private String address;
    private String telephone;
    private String email;
    private Integer status;
    private String remark;

    public boolean createValidate() {
        return id == null &&
                !StringUtils.isEmpty(name) &&
                !StringUtils.isEmpty(address) &&
                !StringUtils.isEmpty(telephone) &&
                !StringUtils.isEmpty(email);
    }

    public boolean updateValidate() {
        return id != null &&
                !StringUtils.isEmpty(name) &&
                !StringUtils.isEmpty(address) &&
                !StringUtils.isEmpty(telephone) &&
                !StringUtils.isEmpty(email) &&
                status != null;
    }
}
